home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 14 / CU Amiga Magazine's Super CD-ROM 14 (1997)(EMAP Images)(GB)(Track 1 of 3)[!][issue 1997-09].iso / CUCD / Programming / AMOS / AMOSList0597 / AMOSLIST / text0264.txt < prev    next >
Encoding:
Text File  |  1997-06-01  |  1.5 KB  |  50 lines

  1. On 23-May-97, Branko Collin sat on a keyboard and produced this mess:
  2.  
  3. > Another thing: I read on this list some time ago an optimisation tip for map
  4. > based games, which was to store the map as many times as there are directions
  5. > you can scroll in. The advantage being, that you can then lay out the map in
  6. > memory in such a way that you have only to increase the pointer to read the
  7. > next tile.
  8.  
  9. > So a scroll to the left would be done
  10. > PTR=??? 'position on the map
  11. > For Y=1 To HEIGHT
  12. >   Inc PTR
  13. >   TILE=Peek(PTR)
  14. >   _PASTE_TILE(X,Y,TILE)
  15. > Next Y
  16.  
  17. > Rather than:
  18. > For Y=1 To HEIGHT
  19. >   TILE=Peek(_START+X+Y*WIDTH)
  20. >   _PASTE_TILE(X,Y,TILE)
  21. > Next Y
  22.  
  23. > The optimisation bit lies in the fact that you don't have much of a
  24. > calculation to determine where to read the next tile from. I don't know if it
  25. > works, as I have never tried it, but it seems genuine enough.
  26.  
  27. Yeah, that's possible... but it could also work as:
  28.  
  29. PTR=Position on map
  30. For Y=1 To HEIGHT
  31.    Add PTR,MAP_WIDTH
  32.    TILE=Peek(PTR)
  33.    _PASTE_TILE[X,Y,TILE]
  34. Next Y
  35.  
  36. ...and then I think it only needs ONE map bank.
  37.  
  38. > How would you deal with such things in your proposed extension?
  39.  
  40. However it is handled, it should be handled internally!
  41.  
  42. Bye ____________________________________________________
  43.    /                                                    \
  44.   / Ben Wyatt - bwyatt@paston.co.uk or b.wyatt@uea.ac.uk \
  45.   \   http://www.paston.co.uk/users/bwyatt/index.html    /
  46.    \____________________________________________________/
  47.         (c)1995-97 Very Interesting Signatures Ltd.
  48.  
  49.  
  50.